import { Entity, PrimaryGeneratedColumn, Column, ManyToMany } from 'typeorm';
import { Content } from '../../content/entities/content.entity';

@Entity('tags')
export class Tag {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ unique: true })
  name: string;

  @ManyToMany(() => Content, content => content.tags)
  contents: Content[];
}